package com.dolphin.business.manager.impl;

import com.dolphin.business.common.utils.PagerModel;
import com.dolphin.business.entity.Adminstrator;
import com.dolphin.business.manager.AbstractManager;
import com.dolphin.business.manager.AdminstratorManager;

public class AdminstratormanagerImpl extends AbstractManager implements AdminstratorManager {

	@Override
	public void addAdminstrator(Adminstrator adminstrator) {
		
		getHibernateTemplate().save(adminstrator);
	}

	@Override
	public void delAdminstratorById(String id) {
		
		getHibernateTemplate().delete(findAdminstratorById(id));
	}

	@Override
	public Adminstrator findAdminstratorById(String id) {
		
		return (Adminstrator)getHibernateTemplate().load(Adminstrator.class, id);
	}

	@Override
	public PagerModel findAllAdminstrators() {
		return searchPaginate("select a from Adminstrator a");
	}

	@Override
	public void updateAdminstrator(Adminstrator adminstrator) {
		
		getHibernateTemplate().update(adminstrator);
	}

}
